str1 = input("请输入：")
str2 = input("请输入：")
str3 = input("请输入：")
str4 = input("请输入：")
str5 = input("请输入：")

fpath = r"D:\document\demo.txt"
with open(fpath, 'w') as f:
    f.write(str1+'\n')
    f.write(str2+'\n')
    f.write(str3+'\n')
    f.write(str4+'\n')
    f.write(str5+'\n')
